import QtQuick 2.0

MouseArea {
    id: _root
    width: 100
    height: 62
    hoverEnabled: true
    property color hoverColor: "#5555ff"
    property color pressColor: "#ff5555"
    property alias color: _bg.color
    property alias text: _text.text

    Rectangle{
        id: _bg
        anchors.fill: parent
    }
    Text{
        id: _text
        anchors.centerIn: parent
    }

    states: [
        State{
            name: "press"
            when: _root.pressed
            PropertyChanges {
                target: _bg
                color: pressColor
            }
        },
        State{
            name: "hover"
            when: _root.containsMouse
            PropertyChanges {
                target: _bg
                color: hoverColor
            }
        }

    ]
}
